package top.lshaci.learning.springboot.jpaquerydsl.qo;

import lombok.Data;
import top.lshaci.learning.springboot.jpaquerydsl.core.*;
import top.lshaci.learning.springboot.jpaquerydsl.entity.QCity;
import top.lshaci.learning.springboot.jpaquerydsl.entity.QProvince;

import java.util.List;

/**
 * CityQo
 *
 * @author liangxu
 */
@Data
@DslFrom(QCity.class)
public class CityQo extends AbstractDslQuery {

//    @DslCondition(matcher = DslMatcher.IN)
//    private Long id;

    @DslCondition(matcher = DslMatcher.IN)
    private List<Long> id;

    @DslConditions({
            @DslCondition(field = "name", matcher = DslMatcher.LK),
            @DslCondition(field = "name", fromClass = QProvince.class, matcher = DslMatcher.LK)
    })
    private String keyword;

    @DslCondition(matcher = DslMatcher.IN)
    private List<String> name;
}
